<%@ page import="java.util.ArrayList"%>
<%@ page import="chase.myrewards.beans.*"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html>
    <head>
        <title>Your Accounts</title>
        <base href="http://my-rewards.appspot.com/" />
        <!-- <base href="http://localhost:8888/" /> -->
        <link rel=stylesheet href="./myrewards.css" type="text/css">
    </head>
    <body>
        <h2>Your Accounts</h2>
        <jsp:useBean id="accountlist" type="chase.myrewards.beans.AccountList" scope="session"/>
        <ul>
        <% ArrayList<Account> l = accountlist.getAccountList(); 
        for (int i = 0; i < l.size(); i++){
            String mask = l.get(i).getMaskedAccountNum();
            String type = l.get(i).getAccountType(); 
            String query = "?accountindex=" + i; 
            String link = "accountinfo"; %>
            <li><a href=<%=link+query%>><%=type + " " + mask %></a></li>
        <% } %>
        </ul>
    </body>
</html>